Skip to content

Allow side-effects to permissions#1069

Merged
GuillaumeRx merged 32 commits into
mainfrom
gr/add-side-effect-permission-controller
Mar 28, 2023
Merged

Allow side-effects to permissions#1069
GuillaumeRx merged 32 commits into
mainfrom
gr/add-side-effect-permission-controller

Conversation

@GuillaumeRx
Copy link
Copy Markdown
Contributor

@GuillaumeRx GuillaumeRx commented Jan 18, 2023

Closes: #1057

This allows permissions to have side-effects. The side-effects are defined in the permission constraint and is handled after the user approved the permissions.

It allows permissions to have a onPermitted side-effect and a onFailure side-effect.

Comment thread packages/permission-controller/src/PermissionController.ts Outdated
Comment thread packages/permission-controller/src/Permission.ts Outdated
Comment thread packages/permission-controller/src/Permission.ts Outdated
@GuillaumeRx GuillaumeRx force-pushed the gr/add-side-effect-permission-controller branch from 7453112 to 2ee530b Compare February 8, 2023 14:10
@GuillaumeRx GuillaumeRx force-pushed the gr/add-side-effect-permission-controller branch 2 times, most recently from 8fb1e60 to 9771e61 Compare February 14, 2023 11:06
@GuillaumeRx GuillaumeRx force-pushed the gr/add-side-effect-permission-controller branch from a0614e1 to f9e11ce Compare February 16, 2023 12:05
@GuillaumeRx GuillaumeRx marked this pull request as ready for review February 16, 2023 12:05
@GuillaumeRx GuillaumeRx requested a review from a team as a code owner February 16, 2023 12:05
@GuillaumeRx GuillaumeRx self-assigned this Feb 16, 2023
@GuillaumeRx GuillaumeRx force-pushed the gr/add-side-effect-permission-controller branch from 495d100 to f183856 Compare March 21, 2023 17:49
@GuillaumeRx
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.1d81ae6",
  "@metamask/announcement-controller": "3.0.0-preview.1d81ae6",
  "@metamask/approval-controller": "2.0.0-preview.1d81ae6",
  "@metamask/assets-controllers": "5.0.0-preview.1d81ae6",
  "@metamask/base-controller": "2.0.0-preview.1d81ae6",
  "@metamask/composable-controller": "2.0.0-preview.1d81ae6",
  "@metamask/controller-utils": "3.0.0-preview.1d81ae6",
  "@metamask/ens-controller": "2.0.0-preview.1d81ae6",
  "@metamask/gas-fee-controller": "4.0.0-preview.1d81ae6",
  "@metamask/keyring-controller": "4.0.0-preview.1d81ae6",
  "@metamask/message-manager": "2.0.0-preview.1d81ae6",
  "@metamask/network-controller": "5.0.0-preview.1d81ae6",
  "@metamask/notification-controller": "2.0.0-preview.1d81ae6",
  "@metamask/permission-controller": "3.0.0-preview.1d81ae6",
  "@metamask/phishing-controller": "3.0.0-preview.1d81ae6",
  "@metamask/preferences-controller": "2.1.0-preview.1d81ae6",
  "@metamask/rate-limit-controller": "2.0.0-preview.1d81ae6",
  "@metamask/subject-metadata-controller": "2.0.0-preview.1d81ae6",
  "@metamask/transaction-controller": "4.0.0-preview.1d81ae6"
}

@GuillaumeRx
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.0a19a24",
  "@metamask/announcement-controller": "3.0.0-preview.0a19a24",
  "@metamask/approval-controller": "2.0.0-preview.0a19a24",
  "@metamask/assets-controllers": "5.0.0-preview.0a19a24",
  "@metamask/base-controller": "2.0.0-preview.0a19a24",
  "@metamask/composable-controller": "2.0.0-preview.0a19a24",
  "@metamask/controller-utils": "3.0.0-preview.0a19a24",
  "@metamask/ens-controller": "2.0.0-preview.0a19a24",
  "@metamask/gas-fee-controller": "4.0.0-preview.0a19a24",
  "@metamask/keyring-controller": "4.0.0-preview.0a19a24",
  "@metamask/message-manager": "2.0.0-preview.0a19a24",
  "@metamask/network-controller": "5.0.0-preview.0a19a24",
  "@metamask/notification-controller": "2.0.0-preview.0a19a24",
  "@metamask/permission-controller": "3.0.0-preview.0a19a24",
  "@metamask/phishing-controller": "3.0.0-preview.0a19a24",
  "@metamask/preferences-controller": "2.1.0-preview.0a19a24",
  "@metamask/rate-limit-controller": "2.0.0-preview.0a19a24",
  "@metamask/subject-metadata-controller": "2.0.0-preview.0a19a24",
  "@metamask/transaction-controller": "4.0.0-preview.0a19a24"
}

@GuillaumeRx
Copy link
Copy Markdown
Contributor Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask/address-book-controller": "2.0.0-preview.44f4e92",
  "@metamask/announcement-controller": "3.0.0-preview.44f4e92",
  "@metamask/approval-controller": "2.0.0-preview.44f4e92",
  "@metamask/assets-controllers": "5.0.0-preview.44f4e92",
  "@metamask/base-controller": "2.0.0-preview.44f4e92",
  "@metamask/composable-controller": "2.0.0-preview.44f4e92",
  "@metamask/controller-utils": "3.0.0-preview.44f4e92",
  "@metamask/ens-controller": "2.0.0-preview.44f4e92",
  "@metamask/gas-fee-controller": "4.0.0-preview.44f4e92",
  "@metamask/keyring-controller": "4.0.0-preview.44f4e92",
  "@metamask/message-manager": "2.0.0-preview.44f4e92",
  "@metamask/network-controller": "5.0.0-preview.44f4e92",
  "@metamask/notification-controller": "2.0.0-preview.44f4e92",
  "@metamask/permission-controller": "3.0.0-preview.44f4e92",
  "@metamask/phishing-controller": "3.0.0-preview.44f4e92",
  "@metamask/preferences-controller": "2.1.0-preview.44f4e92",
  "@metamask/rate-limit-controller": "2.0.0-preview.44f4e92",
  "@metamask/subject-metadata-controller": "2.0.0-preview.44f4e92",
  "@metamask/transaction-controller": "4.0.0-preview.44f4e92"
}

Comment thread packages/permission-controller/src/PermissionController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread tsconfig.packages.json Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/permission-controller/src/PermissionController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Comment thread packages/approval-controller/src/ApprovalController.ts Outdated
Mrtenz
Mrtenz previously requested changes Mar 23, 2023
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a PR description rather than just linking to an issue.

@GuillaumeRx GuillaumeRx dismissed a stale review via e05cd7d March 23, 2023 11:41
@GuillaumeRx GuillaumeRx force-pushed the gr/add-side-effect-permission-controller branch from 73f2318 to e05cd7d Compare March 23, 2023 11:41
@GuillaumeRx GuillaumeRx force-pushed the gr/add-side-effect-permission-controller branch from df812ce to ff1dffb Compare March 28, 2023 17:27
@GuillaumeRx GuillaumeRx merged commit 359cc3c into main Mar 28, 2023
@GuillaumeRx GuillaumeRx deleted the gr/add-side-effect-permission-controller branch March 28, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow side-effects of permissions in PermissionController

6 participants